#
# @lc app=leetcode.cn id=1486 lang=python
#
# [1486] 数组异或操作
#

# @lc code=start
class Solution(object):
    def xorOperation(self, n, start):
        """
        :type n: int
        :type start: int
        :rtype: int
        """
        array = []
        for i in range(n):
            array.append(start + 2*i)
        return reduce(lambda x,y:x^y, array)
# @lc code=end

